<template>
	<div id="content">
		<Header />
		<div class="bread">
			<div class="cont w1200">
				<img src="../../../assets/img/location.png" alt=""><a><router-link
						to="/portal/index">首页</router-link></a> > <a><router-link
						to="/portal/net">网谷里</router-link></a>>
				<a>代表建议</a>

				<a href="" class="back"><img src="../../../assets/img/back.png" alt=""><router-link
						to="/portal/net">返回上一级</router-link></a>
			</div>
		</div>
		<div class="inner">
			<div class="net w1200">
				<h3>代表建议</h3>
				<div class="table">
					<!-- <div class="form-tab">
						<div class="tab-bar">
							<div class="tab active">全部(12)</div>
							<div class="tab">经济建设 (7) </div>
							<div class="tab">生态文明建设 (0)</div>
							<div class="tab">文化建设 (0)</div>
							<div class="tab">政治建设(1) </div>
							<div class="tab">社会建设 (4)</div>
						</div>
						<div class="search">
							<input type="text" placeholder="搜索编号、案由">
							<img src="../../../assets/img/search.png" alt="">
						</div>
						<div class="export">
							<img src="../../../assets/img/export.png" alt="">导出
						</div>
					</div> -->
					<div class="table-type">
						<table border="0">
							<thead>
								<tr>
									<th width="5%"></th>
									<th width="10%">建议人姓名</th>
									<th width="20%">案由</th>
									<th width="10%">建议分类</th>
									<th width="10%">建议日期</th>
									<th width="10%">建议状态</th>
									<th>办理单位</th>
								</tr>
							</thead>
							<tbody>
								<tr v-for="item in List"  @click="goDetail(item.id)">
									<td></td>
									<td>{{ item.suggesterName }}</td>
									<td>{{ item.brief }}</td>
									<td>{{ item.category }}</td>
									<td>{{ item.proposalDate }}</td>
									<td v-if="item.handlingStatus == 0">待处理</td>
									<td v-else>已办结</td>
									<td>{{ item.handlingUnit }}</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="page">
						<pagination v-show="total > 0" :total="total" :page.sync="pageNum" :limit.sync="pageSize"
							@pagination="getData" />
					</div>
				</div>
			</div>
		</div>
		<Contact />
	</div>

</template>

<script>
import Header from '@/components/Header';
import Contact from '@/components/Contact';
import { getSuggestions } from "@/api/website";
export default {
	data() {
		return {
			List: [],
			userInfo: {},
			total: 0,
			pageNum: 1,
			pageSize: 10
		}
	},
	components: {
		Header,
		Contact
	},
	created() {
		this.userInfo = JSON.parse(sessionStorage.getItem("useInfo"))
		this.getData(this.userInfo.id);
	},
	mounted() {

	},
	methods: {
		getData(id) {
			getSuggestions({ id: id, pageNum: this.pageNum, pageSize: this.pageSize }).then(response => {
				this.List = response.rows;
				this.total = response.total;
				for (const key in this.List) {
					this.List[key].checked = false
				}
			});
		},
		goDetail(id){
			this.$router.replace({ path: '/portal/net/suggestionDetail' + '?id=' + id })
		}
	}

};
</script>

<style scoped lang="scss"></style>
